{{ define "admin/login/login.html" }}

<!DOCTYPE HTML>
<html>
<head>
  <title>用户登录</title>
    <link rel="shortcut icon" href="/static/ico/favicon.ico">
    <link rel="bookmark" href="/static/ico/favicon.ico">

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
    <title>GO-Bootstrap</title>
    <meta name="keywords" content="GO 商城">
    <meta name="description" content="基于Bootstrap v4.4.1。">
    <meta name="author" content="青青">
    <link href="/static/ly/css/bootstrap.min.css" rel="stylesheet">
    <link href="/static/ly/css/materialdesignicons.min.css" rel="stylesheet">
    <link href="/static/ly/css/style.min.css" rel="stylesheet">
   </head>
<div class="row no-gutters bg-white vh-100">
    <div class="col-md-6 col-lg-7 col-xl-8 d-none d-md-block" style="background-image: url(/static/ly/images/login-bg-1.jpg); background-size: cover;">

        <div class="d-flex vh-100">
            <div class="p-5 align-self-end">
                <img src="/static/ly/images/logo.png" alt="...">
                <br><br><br>
                <p class="text-white">一个后台管理系统的，基于Bootstrap v4.4.1。</p>
            </div>
        </div>

    </div>

    <div class="col-md-6 col-lg-5 col-xl-4 align-self-center">
        <div class="p-5">
            <div class="text-center">
                <a href="#"> <img alt="light year admin" src="/static/ly/images/logo-sidebar.png"> </a>
            </div>
            <p class="text-center text-muted"><small>请使用您的账号登录系统</small></p>
            <form action="/admin/doLogin" method="post" id="loginForm">
                <input type="hidden" name="captchaId" id="captchaId">
                <div class="form-group">
                    <label for="username">用户名</label>
                    <input type="text" class="form-control" id="username" name="username" autocomplete="off" placeholder="请输入您的用户名">
                </div>

                <div class="form-group">
                    <label for="password">密码</label>
                    <input type="password" class="form-control" id="password" name="password" placeholder="请输入您的密码">
                </div>

                <div class="form-group">
                    <label for="verifyValue">验证码</label>
                    <div>
                        <input style="width: 72% ;display: inline-block" autocomplete="off" class="form-control" id="verify" name="verifyValue" placeholder="请输入验证码">
                        <img id="captchaImg" style="width: 25%;vertical-align: top;" src="">
                    </div>

                </div>

                <div class="form-group">
                    <div class="custom-control custom-checkbox">

                        <input type="checkbox" class="custom-control-input" id="rememberme">
                        <label class="custom-control-label not-user-select" for="rememberme">5天内自动登录</label>
                    </div>
                </div>

                <div class="form-group">
                    <button class="btn btn-block btn-primary" type="submit" name="dosubmit">立即登录</button>
                </div>
            </form>
        </div>
    </div>
</div>
<script type="text/javascript" src="/static/ly/js/jquery.min.js"></script>
<script type="text/javascript">
    $(function(){
        loginApp.init();
    })
    var loginApp={
        init:function(){
            this.getCaptcha()
            this.captchaImgChage()
        },
        getCaptcha:function(){
            $.get("/admin/captcha?t="+Math.random(),function(response){
                console.log(response)
                $("#captchaId").val(response.captchaId)
                $("#captchaImg").attr("src",response.captchaImage)
            })
        },
        captchaImgChage:function(){
            var that=this;
            $("#captchaImg").click(function(){
                that.getCaptcha()
            })
        }
    }
</script>

{{end}}